package com.example.springboot011httpservice.service;

import com.example.springboot011httpservice.model.Albums;
import com.example.springboot011httpservice.model.AlbumsRecord;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;

@HttpExchange(url = "https://jsonplaceholder.typicode.com/")
public interface AlbumsService {
    @GetExchange("/albums/{id}")
    Albums getById(@PathVariable Integer id);


    @HttpExchange(url = "/albums/{aid}", method = "GET",
    contentType = MediaType.APPLICATION_JSON_VALUE)
    Albums getById2(@PathVariable Integer aid);

    // 返回java Record类型
    @GetExchange("/albums/{id}")
    AlbumsRecord getByIdReturnRecord(@PathVariable Integer id);
}
